#include <iostream>

using namespace std;

const int N = 1e5 + 10;
int a[N], f[N];
int n;

int main()
{
	cin >> n;
	for(int i = 1; i <= n; i++) cin >> a[i];
	for(int i = 1; i <= n; i++) f[i] = f[i - 1] + a[i];
	int ret = 0x3f3f3f3f;
	for(int len = 1; len <= n; len++)
	{
			int j = len + 1 - 1;
			ret = min(ret, f[j] - f[0]);
	}
	cout << abs(ret) + 1 << endl;
	return 0;
	
}
